package br.com.felix.fwt.svg.image;

import br.com.felix.fwt.svg.SVG;
import br.com.felix.fwt.svg.SVGBuilder;

public class SVGImage implements SVG{

	private int x,y,width,height;
	private String href;
	
	//<image x="0" y="20" width="200" height="180" xlink:href="cat.png" />
	
	
	@Override
	public void toSVG(SVGBuilder svgBuilder) {
		svgBuilder.createElement("image")
			.x(x)
			.y(y)
			.width(width)
			.height(height)
			.xlinkHref(href)
			.endElementNoBody();
	}

	
	public SVGImage x(int x){
		this.x = x;
		return this;
	}
	
	public SVGImage y(int y){
		this.y = y;
		return this;
	}
	
	public SVGImage width(int width){
		this.width = width;
		return this;
	}
	
	public SVGImage height(int height){
		this.height = height;
		return this;
	}
	
	public SVGImage href(String href){
		this.href = href;
		return this;
	}
}
